﻿function showLonLat(lon, lat) {
    var lonstr = lon > 0 ? "东经：" : "西经：";
    var latstr = lat > 0 ? "北纬：" : "南纬：";
    return lonstr + Math.abs(lon) + "\r\n" + latstr + Math.abs(lat);
}

function jump_location(x, y, level) {
    require([
        "esri/geometry/SpatialReference",
        "esri/geometry/Point",

    ], function (SpatialReference, Point) {
        var cityCenter = new Point(x, y, new SpatialReference({ wkid: 4490 }));
        window.mapView.goTo(
            { target: cityCenter, level }
        );
    });
}
function shineDateTime() {
    function checkTime(i) {
        if (i < 10) { i = "0" + i }
        return i
    }

    //发光时间
    function updateDateTime() {
        const today = new Date();
        var strDate = (" " + today.getFullYear() + "年" + (today.getMonth() + 1) + "月" + today.getDate() + "日");
        var n_day = today.getDay();
        var strWeek = "";
        switch (n_day) {
            case 0:
                { strWeek = " 星期日 " } break;
            case 1:
                { strWeek = " 星期一 " } break;
            case 2:
                { strWeek = " 星期二  " } break;
            case 3:
                { strWeek = " 星期三 " } break;
            case 4:
                { strWeek = " 星期四 " } break;
            case 5:
                { strWeek = " 星期五 " } break;
            case 6:
                { strWeek = " 星期六 " } break;
            case 7:
                { strWeek = " 星期日 " } break;
        }
        //增加时分秒  
        // add a zero in front of numbers<10  
        var h = today.getHours();
        var m = today.getMinutes();
        var s = today.getSeconds()
        m = checkTime(m);
        s = checkTime(s);
        strTime = h + ":" + m + ":" + s;
        document.getElementById('date').textContent = strDate
        document.getElementById('week').textContent = strWeek;
        document.getElementById('time').textContent = strTime;
    }
    setInterval(updateDateTime, 1000); // Update date and time every second
    updateDateTime(); // Initialize
}

function closeHuoQing() {
    return  '';
}